Copyright: version 1.0


Contents

Purpose

Methods

Properties

Events

Files

Installation

Registration

New since version 1.0


What is CTLUpd?
CTLUpd

There are a lot of small Delphi-applications that are frequently updated and upgraded. If you send your users a floppy with a new version of the software, it is sometimes hard to explain how they must use a filemanager, an explorer or even a DOS-command to copy the new EXE-file to the right place.

Suppose the user gets a floppy with a new EXE. This user inserts the floppy and just starts the application. If CTLUpd is executed as the first statement in the mainforms OnCreate-handler, it will look for an update of the EXE-file on the floppydisk, copy this file over the original EXE-file and then prompts the user to restart the application. Update is done. This works OK as long as no locked files are involved, like loaded DLL’s, open databases etcetera. Therefore CTLUpd copies only the applications EXE-file.

Of course the update can be in any directory on any reachable drive. Maybe you send an update via a modem, or have an update ready on a network.

The CTLUPd *must* be executed from the mainforms oncreate-event, as the first statement before any data being processed, because the EXE-file is overwritten during the copy-process and Windows doesn’t know about the state of the EXE-file. Of course you can read an ini-file first, if necessary, but don’t open new forms, don’t open files etc.

Before the copyprocess starts, CTLUpd creates a backup copy of the original App.EXE under the name App.OLD, if the CreateBackup property is True (default).

The prompt-text at the beginning and at the end of the copy-process can be modified to suit language needs.

Using the UpdateStyle property, the copyprocess can also be done silently, only the restart-prompt will show.


CTLUpd Events

Currently (version 1.00) there are no events defined.


CTLUpd Methods

The Execute method (function) starts the copying process.

Possible results:

0: Copy Done Normally

1: Drive Not Ready

2: Directory Not Found

3: File Not Found

4: File Not Younger

5: Cancelled

Normally, you should not get to see the result 0, because the application is terminated. The EXE-file is overwritten and therefore the application must stop immediately.

Example:

procedure TForm1.FormCreate(Sender: TObject);

var

  Errorvalue : integer;

begin

  {... maybe read some property-settings from an ini-file}

  ErrorValue := CTLUpd1.Execute;

  ShowMessage(‘An error occurred in the Update-process: ‘+

               inttostr(ErrorValue));

  {... other stuff ... }

end;


CTLUpd Properties

SourceDir

StartPrompt

EndPrompt

UpdateStyle

Version

CreateBackup


Files with CTLUpd
CTLUpd Properties SourceDir

string

The SourceDir property is the directory where the new App.EXE is to be found.

The sourcedir can be any reachable drive/directory.

DefaultValue: A:\


Startprompt
CTLUpd Properties StartPrompt

string

The Startprompt is the text that asks the user if he likes to update.

The default value is English text, but you cab change it to any text in any language. If the UpdateStyle is set to anything other then us_Ask, the prompt is NOT shown.


EndPrompt
CTLUpd Properties EndPrompt

string

The EndPrompt is the text in a dialogbox that appears at the end of the copy process.


UpdateStyle
CTLUpd Properties UpdateStyle

enum

UpdateStyle can have three values:

us_NoUpdate:	No update is performed. Control goed back to the calling application.

us_Ask:	The startprompt text appears, asking if the user wants to update.

us_AutoUpdate:	No startprompt is displayed. If an update exists, the update is performed.


Version
CTLUpd Properties Version

string

The Version info is readonly. It shows the versionnumber of this component.


CreateBackup
CTLUpd Properties CreateBackup

boolean

If CreateBackup is set to True (the default), then before overwriting App.EXE, a backupcopy App.OLD is made.


Files with CTLUpd
CTLUpd Files

You should have the following files found in the zip:

CTLUpd.dcu

CTLUpd.dcr

CTLUpd.hlp

CTLUpd.cnt

CTLUpd.kwf

Registered users will also find CTLUpd.PAS.


CTL Registration
Registration

The CTLUpd component, a way of distributing software that I think is well known and understood and does not need further explanation.

The evaluation version shows a screen each time the application is started.

The registrationfee is $16 and includes free updates via e-mail for one year.

How to register:

Via Compuserve:

GO SWREG # 15999

Via snailmail:

John van de Waeter PC Applicaties

Sottegemstraat 44

4382 EN  Vlissingen

The Netherlands

Via bank:

VSB 87.52.94.863

You’ll receive your copy of the component via Internet e-mail or Compuserve e-mail. If you like a floppy being sent to you, please add $5.

Check my homepage for latest news:

HTTP://www.xs4all.nl/~pa3erp

Please send any comments by email to

JohnvdW@compuserve.com

or

pa3erp@xs4all.nl

Disclaimer:

All the usual legal stuff goes here: I am not responsible for anything done with this software or anything done by this software. USE AT YOUR OWN RISC!

By using this software you accept this disclaimer.


Installation

Installing the component

•	Copy the file CTLUPD.DCU to your Delphi component directory.

•	Copy the file CTLUPD.DCR to your Delphi component directory

•	Start Delphi

•	Coose Options/Install components

•	Click on Add

•	Click on Browse

•	View files of type DCU

•	Browse to the Delphi component directory

•	Click on CTLUPD.DCU

•	Click OK

•	Your component library is recompiled and the TCTLUpd component should appear on the CTL palette page.

Installing the helpfile

•	Copy the file CTLUpd.HLP to the Delphi\BIN directory

•	Copy the file CTLUpd.KWF to the Delphi\HELP directory

•	Switch to the Delphi\Help\Tools directory

•	Start HELPINST.EXE

•	Open the Delphi HDX file, usually in the Delphi\Bin directory

•	Press the + button

•	Add the file CTLUpd.KWF

•	Save & Exit

•	Restart Delphi. Selecting the CTLUpd component and pressing F1 should open the proper Help-screens.


NEW

CTLUpd Version 1.00  (August 1997) first issue

No Upgrades/updates yet.